#include<iostream>
#include<string>
using namespace std;
#include<fstream>

//
class Person
{
public:
	char name[64];
	int age;
};


void test02()
{
	Person p;


	ifstream ifs;

	ifs.open("file.txt",ios::in|ios::binary);

	if (!ifs.is_open())
	{
		cout << "error" << endl;
		return;
	}

	ifs.read((char *)&p, sizeof(Person));

	cout << p.name << " " << p.age << endl;

	ifs.close();
}

int main()
{
	test02();

	system("pause");
	return 0;
}